home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / canvasmode_measurements.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-09-23  |  1.8 KB  |  66 lines

  1. /*
  2.  For general Scribus (>=1.3.2) copyright and licensing information please refer
  3.  to the COPYING file provided with the program. Following this notice may exist
  4.  a copyright and/or license notice that predates the release of Scribus 1.3.2
  5.  for which a new license (GPL+exception) is in place.
  6.  */
  7. /***************************************************************************
  8. *                                                                         *
  9. *   This program is free software; you can redistribute it and/or modify  *
  10. *   it under the terms of the GNU General Public License as published by  *
  11. *   the Free Software Foundation; either version 2 of the License, or     *
  12. *   (at your option) any later version.                                   *
  13. *                                                                         *
  14. ***************************************************************************/
  15.  
  16.  
  17.  
  18. #ifndef CANVAS_MODE_MEASUREMENTS_H
  19. #define CANVAS_MODE_MEASUREMENTS_H
  20.  
  21. #include <QObject>
  22. #include "canvasmode.h"
  23. #include "fpoint.h"
  24.  
  25. class Measurements;
  26. class ScribusMainWindow;
  27. class ScribusView;
  28.  
  29.  
  30. /**
  31.   shows measurements between mouse press and mouse release point
  32. */
  33. class MeasurementsMode : public CanvasMode
  34. {
  35.     Q_OBJECT
  36.     
  37. public:
  38.     MeasurementsMode(ScribusView* view);
  39.  
  40.     virtual void enterEvent(QEvent *);
  41.     virtual void leaveEvent(QEvent *);
  42.     
  43.     virtual void activate(bool);
  44.     virtual void deactivate(bool);
  45.     virtual void mouseReleaseEvent(QMouseEvent *m);
  46.     virtual void mouseMoveEvent(QMouseEvent *m);
  47.     virtual void mousePressEvent(QMouseEvent *m);
  48.     virtual void drawControls(QPainter* p);
  49.  
  50. public slots:
  51.     void setActive(bool);
  52.  
  53. private:
  54.     void adjustPoint(QPoint point);
  55.     void showValues();
  56.     bool m_active;
  57.     QPoint m_start;
  58.     QPoint m_current;
  59.     FPoint m_startDoc;
  60.     FPoint m_currentDoc;
  61.     Measurements* m_palette;
  62. };
  63.  
  64.  
  65. #endif
  66.